﻿Class TestRegularExpressionValidation
    Public Shared Sub Main()
        Dim numbers As String() = {"123-456-7890", "444-234-22450", "690-203-6578", "146-893-232", "146-839-2322", "4007-295-1111", _
         "407-295-1111", "407-2-5555"}

        Dim sPattern As String = "^\d{3}-\d{3}-\d{4}$"

        For Each s As String In numbers
            System.Console.Write("{0,14}", s)

            If System.Text.RegularExpressions.Regex.IsMatch(s, sPattern) Then
                System.Console.WriteLine(" - valid")
            Else
                System.Console.WriteLine(" - invalid")
            End If
        Next
    End Sub
End Class

